package org.shushan.web.demo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.shushan.framework.core.entity.DeletableEn;
import org.shushan.framework.core.mapstruct.EnMapstruct;
import org.shushan.web.demo.response.MybatisTestVo;

import java.io.Serializable;

/**
 * (TUser)实体
 * @author zhigang.li
 * @email 2429967859@qq.com
 * @since 2023-09-16 22:25:41
 */
@Getter
@Setter
@TableName("t_user")
public class MybatisTest extends DeletableEn<Long> implements EnMapstruct<MybatisTestVo>,Serializable {
    private static final long serialVersionUID = -28434004787627803L;
    private Long id;
    private String username;
    private String phone;
    private String address;
    private String sex;

    @Override
    public MybatisTestVo toVo() {
        return MyatisTestMapper.INSTANCE.toVo(this);
    }

    @Mapper
    interface MyatisTestMapper {
        MyatisTestMapper INSTANCE = Mappers.getMapper(MyatisTestMapper.class);
        MybatisTestVo toVo(MybatisTest mybatisTest);
    }

}

